{include file='imobile_header.tpl'}

<div id="topbar">
  <div id="leftnav"> 
    <a href="user_home.php"><img alt="home" src="./include/imobile/iwebkit/images/home.png" /></a>
    <a href="javascript:history.go(-1);">{lang_print id=11340015}</a>
  </div> 
	<div id="title"> 
		{lang_print id=11340089}
	</div> 
</div>

<div id="tributton"> 
	<div class="links"> 
		<a href="javascript: iMobile_profileSwitchTab('profile');">{lang_print id=11340094}</a><a href="javascript: iMobile_profileSwitchTab('comments');">{lang_print id=11340095}</a><a href="javascript: iMobile_profileSwitchTab('friends');">{lang_print id=11340096}</a>
	</div> 
</div> 

<div id="content">

	<div id="profile_overview">
  {if $business->businessowner_level_info.level_business_photo && $business->business_info.business_photo}	
		<img src='{$business->business_photo("./images/nophoto.gif")}' border='0' width="90" />
  {/if} 		
		<div>
			<span class="name">{$business->business_info.business_title}</span>
			<div class="status">
			  <div class="business_info_category">{* lang_print id=11290134 *} 
			  {if $business->business_info.businesscat_parent_title}
			    {capture assign=cat_title}{lang_print id=$business->business_info.businesscat_parent_title}{/capture}
			    <a href="{$url->url_create('business_category', $rc_toolkit->generate_slug($cat_title), $business->business_info.businesscat_dependency)}">{lang_print id=$business->business_info.businesscat_parent_title}</a>
			     &raquo;
			  {/if}
			  {capture assign=cat_title}{lang_print id=$business->business_info.businesscat_title}{/capture}
			  <a href="{$url->url_create('business_category', $rc_toolkit->generate_slug($cat_title), $business->business_info.businesscat_id)}">{lang_print id=$business->business_info.businesscat_title}</a>
			  </div>  
			
			  {if $business->business_info.business_neighborhood}
			  <div class="business_info_neighborhood">
			    {* lang_print id=11290095 *} <span><a href="{$url->url_create('business_neighborhood', null, $business->business_info.business_neighborhood)}">{$business->business_info.business_neighborhood}</a></span>
			  </div>
			  {/if}
			</div>
		</div>
		
	</div>
	<div style="clear: both"></div>
	

    
	<div id="profile_profile" style="display: {if empty($v) || $v == "profile"}block{else}none{/if}">
	  <ul class="pageitem">
	    <li class="key_value">
		     <span class="key">{lang_print id=11340097}</span>
		     <span class="value">{$business->business_info.business_location_street}{if $business->business_info.business_location_street && $business->business_info.business_location_unit}, {/if}{$business->business_info.business_location_unit}
		        <br />{$business->business_info.business_location_city}{if $business->business_info.business_location_city && ($business->business_info.business_location_province || $business->business_info.business_location_postal)}, {/if}
		        {$business->business_info.business_location_province} {$business->business_info.business_location_postal}
		        <br />{$business->business_info.business_location_country}
		     </span>
		  </li>
		  {if $business->business_info.business_phone}
		  <li class="key_value">
		    <span class="key">{lang_print id=11340098}</span>
		    <span class="value"><a href="tel:{$business->business_info.business_phone}">{$business->business_info.business_phone}</a></span>
		  </li>
		  {/if}
      {if $business->business_info.business_url}
      <li class="key_value">
        <span class="key">{lang_print id=11340099}</span>
        <span class="value"><a href="{$business->business_info.business_url}" target="_blank">{$business->get_business_url_host()}</a></span>
      </li>
      {/if}
	    </li>
	  </ul>
	
	  
	  {section name=cat_loop loop=$cats}
	  {if $cats[cat_loop].fields|@count}<ul class="pageitem">{/if}
       {section name=field_loop loop=$cats[cat_loop].fields}
         <li class="key_value">
           <span class="key">{lang_print id=$cats[cat_loop].fields[field_loop].field_title}:</span>
           <span class="value">{$cats[cat_loop].fields[field_loop].field_value_formatted}</span>
         </li>
       {/section}
     {if $cats[cat_loop].fields|@count}</ul>{/if} 
     {/section}  
	       
    {* SHOW PROFILE CATS AND FIELDS *}
    {if $business->business_info.businesstype_profile > 0 && $business->get_businessprofilecat_id()}
    {section name=profilecat_loop loop=$profilecats}
      {section name=subprofilecat_loop loop=$profilecats[profilecat_loop].subcats}
        <span class="graytitle">{lang_print id=$profilecats[profilecat_loop].subcats[subprofilecat_loop].subcat_title}</span>
        <ul class="pageitem">
        {* LOOP THROUGH FIELDS IN TAB, ONLY SHOW FIELDS THAT HAVE BEEN FILLED IN *}
        {section name=field_loop loop=$profilecats[profilecat_loop].subcats[subprofilecat_loop].fields}
          <li class="key_value">
            <span class="key">{lang_print id=$profilecats[profilecat_loop].subcats[subprofilecat_loop].fields[field_loop].field_title}</span>
            <span class="value">{$profilecats[profilecat_loop].subcats[subprofilecat_loop].fields[field_loop].field_value_formatted}
            {if $profilecats[profilecat_loop].subcats[subprofilecat_loop].fields[field_loop].field_special == 1 && $profilecats[profilecat_loop].subcats[subprofilecat_loop].fields[field_loop].field_value|substr:0:4 != "0000"} ({lang_sprintf id=852 1=$datetime->age($profilecats[profilecat_loop].subcats[subprofilecat_loop].fields[field_loop].field_value)}){/if}
            </span>
          </li>
        {/section}
        </ul>
      {/section}
    {/section}
    {/if}
    {* END PROFILE TABS AND FIELDS *}  
	       
	</div>
	<!-- /profile_info -->

	<div id="profile_comments" style="display: {if $v == "comments"}block{else}none{/if}">
		
		<span class="graytitle">{lang_sprintf id=11340100  1=$comments|@count}
			
		</span>
		<ul class="pageitem">
		{if $allowed_to_comment && $user->user_exists}
			<li class="feed">
				<img src='./images/icons/action_postcomment.gif' border='0' class='icon'/ >
				<div class="action"><a href="javascript: iMobile_toggle('#post_comment_form');" style="color: #666; font-style: italic;">{lang_print id=11340036}</a></div>
			</li>

			<li class="textbox" id="post_comment_form" style="display: none;">
				<form action="imobile.php" method="POST" onSubmit="return iMobile_postComment();" name="comment_form"><input id="submit" type="hidden" />
				<textarea id="comment_body" name="comment_body" rows="4"></textarea>
				<input name="submit" type="submit" value="Post Comment" class="iPush" />

				<input name="task" value="user_post_comment" type="hidden">
				
				<input type="hidden" value="business" name="type">
				<input type="hidden" value="business_id" name="iden">
				<input type="hidden" value="{$business->business_info.business_id}" name="value">
				<input type="hidden" value="business" name="object_owner">
				<input type="hidden" value="{$business->business_info.business_id}" name="object_owner_id">
				<input type="hidden" value="businesses" name="tab">
				<input type="hidden" value="business" name="col">	
				
				</form>
			</li>
		{/if}	
		{foreach from=$comments item=comment_data}
	        <li class="uitem">
	           <img src='{$comment_data.comment_author->user_photo('./images/nophoto.gif')}' border='0' class='icon' alt='' />
	           <div class="data">
	            	<span class="name"><a href="{$url->url_create('profile',$comment_data.comment_author->user_info.user_username)}">{$comment_data.comment_author->user_displayname}</a></span>
	            	<span class="comment">{$comment_data.comment_body}</span>
	                <span class="date">{$datetime->cdate("`$setting.setting_dateformat` `$setting.setting_timeformat`", $datetime->timezone($comment_data.comment_date, $global_timezone))}</span>
	           </div>
	        </li>
		{/foreach} 
        </ul>
	</div>
	<!-- /profile_activity -->

	
	<div id="profile_friends" style="display: {if $v == "friends"}block{else}none{/if}">
	
		<span class="graytitle">{lang_print id=11290161}</span> 
    <ul class="pageitem">
          <li class="textbox">
            {$business->business_info.business_desc}
          </li>
    </ul>
	</div>
	

</div>

{include file='imobile_footer.tpl'}
